cmake_minimum_required(VERSION 3.15.7)
project(farado-binara)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Опции сборки проекта
# ---------------------------------------------------------------------------- #
option(BUILD_DATENARO_SERVICE "Build datenaro service" ON)
option(BUILD_RETEJO_SERVICE "Build retejo service" ON)
option(BUILD_F2FB_TOOL "Build farado to farado-binara tool" ON)
option(BUILD_TESTS "Build tests" ON)
option(BUILD_ALL "Build all" OFF)
# ---------------------------------------------------------------------------- #

if(BUILD_DATENARO_SERVICE OR BUILD_ALL)
    add_subdirectory(src/datenaro)
endif()

if(BUILD_RETEJO_SERVICE OR BUILD_ALL)
    add_subdirectory(src/retejo)
endif()

if(BUILD_F2FB_TOOL OR BUILD_ALL)
    add_subdirectory(tools/f2fb)
endif()

if(BUILD_TESTS OR BUILD_ALL)
    enable_testing()
    add_subdirectory(tests)
endif()

set(CONFIG_FILE ${CMAKE_SOURCE_DIR}/res/config.ini)
install(
    FILES ${CONFIG_FILE}
    DESTINATION ${CMAKE_SOURCE_DIR}/install/bin
)
